
import request from '@/utils/request.js'


//  4-获取用户频道列表
export const channels_api = (mobile) => {
    return request({
        url: `/app/v1_0/user/channels`,
        method: 'get',
    })
}

//  5-频道新闻推荐_V1.0
export const articles_api = (params) => {
    return request({
        url: `/app/v1_1/articles`,
        method: 'get',
        params: {
            channel_id: params.channel_id,
            timestamp: params.timestamp,
            with_top: params.with_top
        }
        // params: {
        //     channel_id: channel_id,
        //     timestamp: +new Date(),
        //     with_top: 1
        // }
    })
}

//6-所有的频道    全部频道列表
export const channelsAll_api = (mobile) => {
    return request({
        url: `/app/v1_0/channels`,
        method: 'get',
    })
}

//  7-添加频道
/**
 * 添加用户频道
 */
export const channelsAdd_api = channels => {
    return request({
      method: 'PATCH',
      url: '/app/v1_0/user/channels',
      data: {
        channels
      }
    })
  }

//  7-删除频道
export const channelsDel_api = (target) => {
    return request({
        url: `/app/v1_0/user/channels/`+target,
        method: 'delete',
    })
}

